﻿//  Write a program that parses an URL address given in the format:
//      [protocol]://[server]/[resource]
// and extracts from it the [protocol], [server] and [resource] elements.
// For example from the URL http://www.devbg.org/forum/index.php the following information should be extracted:
//      [protocol] = "http"
//		[server] = "www.devbg.org"
//      [resource] = "/forum/index.php"

using System;

public class ParseUrlAddress
{
    public static void Main()
    {
        string url = "http://www.devbg.org/forum/index.php";

        Uri uri = new Uri(url);

        Console.WriteLine("[protocol] = {0}", uri.Scheme);
        Console.WriteLine("[server] = {0}", uri.Authority);
        Console.WriteLine("[resource] = {0}", uri.LocalPath);
    }
}